import requests from '@src/common/request'

//获取商户门店区域
export function getShopArea(data) {
  return requests.get({
    url: '/userShop/shop/getShopArea',
    data: data
  })
}

export function getStoreList(data) {
  return requests.post({
    url: '/mall/anon/store/list',
    data: data
  })
}


//获取商品一二级分类
export function getStoreMenu(data) {
  return requests.post({
    url: '/mall/anon/menu/detail',
    data: data
  })
}


//获取一二级商品列表
export function getStoreGoodsList(storeId, data) {
  return requests.post({
    url: '/mall/anon/menu/storeItem?storeId=' + storeId,
    data: data
  })
}

//获取附近门店
export function getNearStore(data) {
  return requests.get({
    url: '/mall/anon/store/nearby_store',
    data: data
  })
}

//获取配送方式
export function getDispatchWay(data) {
  return requests.post({
    url: '/mall/anon/menu/getItemsDelivery',
    data: data
  })
}

//获取店铺详情
export function getStoreDetail(req) {
  if (req.latitude) {
    return requests.get('/mall/anon/store/detail?storeId=' + req.storeId + '&latitude=' + req.latitude + "&longitude=" + req.longitude)
  } else {
    return requests.get('/mall/anon/store/detail?storeId=' + req.storeId)
  }
}


//获取优惠券
export function getCoupon(data) {
  return requests.get({
    url: '/couponApp/coupon/shelfList',
    data: data
  })
}

//领取优惠券
export function pullDownCoupon(data) {
  return requests.post({
    url: '/couponApp/coupon/receiveCoupon',
    data: data
  })
}


export function getQrcodeMsg(data) {
  return requests.get({
    url: '/qr/selectByCodeNo',
    data: data
  })
}

//获取商品、门店支付方式交集接口
export function getGoodsAndShopJoinPayChannels(data) {
	return requests.post({
		url: '/mall/mobile/order/getGoodsAndShopJoinPayChannels',
		data: data
	})
}
